<template>
  <div class="new-song-card-horizontal">
    <el-image
      class="new-song-cover"
      :src="coverUrl"
      fit="cover"
      :preview-src-list="[coverUrl]"
    />
    <div class="new-song-info">
      <div class="new-song-name">{{ name }}</div>
      <div class="new-song-author">{{ author }}</div>
    </div>
  </div>
</template>

<script setup lang="ts">
interface Props {
  coverUrl: string;
  name: string;
  author?: string;
}

const props = withDefaults(defineProps<Props>(), {
  author: '未知作者'
});
</script>

<style scoped>
.new-song-card-horizontal {
  width: 385px;
  height: 120px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background-color: #000000;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.new-song-card-horizontal:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.new-song-cover {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 0 !important;
}

.new-song-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.new-song-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-song-author {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>